<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateDevicesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('devices', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('skin_detector_id')->default(0)->comment('deprecated, 未来可能多对多关联 关联skin_detectors表');
			$table->integer('device_spec_id')->default(1)->comment('设备试妆参数ID');
			$table->string('uuid', 100)->unique('d_uuid')->comment('设备的编号（随机数字）(Unique)');
			$table->string('code', 100)->default('')->comment('设备型号，可重复');
			$table->string('device_name')->nullable()->comment('设备的名称');
			$table->string('specification')->nullable()->comment('规格，型号的值');
			$table->string('producer')->nullable()->comment('生产商');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('devices');
	}

}
